/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beanInfo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author VANTRUY
 */
@Entity
@Table(name = "AdminRole")
@NamedQueries({
    @NamedQuery(name = "AdminRole.findAll", query = "SELECT a FROM AdminRole a"),
    @NamedQuery(name = "AdminRole.findByAdminID", query = "SELECT a FROM AdminRole a WHERE a.adminID = :adminID"),
    @NamedQuery(name = "AdminRole.findByAdminName", query = "SELECT a FROM AdminRole a WHERE a.adminName = :adminName")})
public class AdminRole implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "adminID")
    private Integer adminID;
    @Column(name = "adminName")
    private String adminName;
    @Lob
    @Column(name = "description")
    private String description;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "adminRole")
    private List<User> userList;

    public AdminRole() {
    }

    public AdminRole(Integer adminID) {
        this.adminID = adminID;
    }

    public Integer getAdminID() {
        return adminID;
    }

    public void setAdminID(Integer adminID) {
        this.adminID = adminID;
    }

    public String getAdminName() {
        return adminName;
    }

    public void setAdminName(String adminName) {
        this.adminName = adminName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<User> getUserList() {
        return userList;
    }

    public void setUserList(List<User> userList) {
        this.userList = userList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (adminID != null ? adminID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AdminRole)) {
            return false;
        }
        AdminRole other = (AdminRole) object;
        if ((this.adminID == null && other.adminID != null) || (this.adminID != null && !this.adminID.equals(other.adminID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beanInfo.AdminRole[adminID=" + adminID + "]";
    }

}
